import config from '../../utils/config';
import apiCreator from '../../utils/apiCreator';

const api = apiCreator();

export default {
  //删除某个模板
  deleteById: {
    main: (query) => api.get(`${config.interfaces.type1}productModelMenu/deleteModel`, query),
    barra: (query) => api.get(`${config.interfaces.type1}barraProductModelMenu/deleteModel`, query),
  },
  //获取模板列表
  getModuleList: {
    main: (query) => api.get(`${config.interfaces.type1}productModelMenu/queryModelList`, query),
    barra: (query) => api.get(`${config.interfaces.type1}barraProductModelMenu/queryModelList`, query),
  },
  //获取模板设置树形结构
  queryTreeData: {
    main: (query) => api.get(`${config.interfaces.type1}productModelMenu/queryModelTree`, query),
    barra: (query) => api.get(`${config.interfaces.type1}barraProductModelMenu/queryModelTree`, query),
  },
  //保存模板数据
  saveModuleData: {
    main: (query) => api.post(`${config.interfaces.type1}productModelMenu/saveOrUpdateModel`, query),
    barra: (query) => api.post(`${config.interfaces.type1}barraProductModelMenu/saveOrUpdateModel`, query),
  },
  //获取资产大类数据
  queryAssetsData: (query) => api.post(`${config.interfaces.type3}assetallocation/holdStatistics/`, query),
  //获取占比变动趋势图数据
  queryTendencyChartData: (query) => api.post(`${config.interfaces.type3}assetallocation/scaleChangeTrend/`, query),
  //获取 前10大重仓
  queryMarkeData: (query) => api.post(`${config.interfaces.type3}assetallocation/topNHoldDetail/`, query),
  //获取区间维度信息
  getEchartDate1: (query) => api.post(`${config.interfaces.type3}portfoliopnl/intervalCount/`, query),
  //获取资产维度统计信息
  getEchartDate2: (query) => api.post(`${config.interfaces.type3}portfoliopnl/majorAssetCount/`, query),
  // 获取当前产品在指定时间范围内的大类资产内部排序
  getEchartInfo: (query) => api.post(`${config.interfaces.type3}portfoliopnl/majorAssetTop/`, query),
  //获取交易统计信息
  getTradeCount: (query) => api.get(`${config.interfaces.type3}tradeanalysis/tradeCount`, query),
  // 风险变动
  riskDailyChg: (query) => api.get(`${config.interfaces.type3}portfolio/riskDailyChg/`, query),
  /**
   * 收益率表现
   */
  // 组合概览-收益率风险概览-收益率
  yieldOrgLevel: (query) => api.get(`${config.interfaces.type3}portfolio/yieldPerDuration/`, query),
  // 收益率表现-区间收益率接口
  getYieldRateData: (query) => api.post(`${config.interfaces.type3}yieldanalysis/intervalYieldCmp/`, query),
  // 收益率表现-收益率趋势接口
  getYieldTrend: (query) => api.post(`${config.interfaces.type3}yieldanalysis/yieldTrendCmp/`, query),
  /**
   * 净值分析
   */
  // 净值分析-趋势图接口
  getReNetvaluelist: (query) => api.get(`${config.interfaces.type1}portfolioAnalyse/reNetvaluelist`, query),
  // 净值分析-大事记时间线
  getTimeLine: (query) => api.get(`${config.interfaces.type3}portfolio/timeline/`, query),
  // 基本信息
  getBasicInfoData: (query) => api.get(`${config.interfaces.type1}productOverView/queryBasicInfo`, query),
};
